package observer.observer;

/**
 * @author: zhouyang
 * @descrpition:
 * @time: 2019-04-28 20:11
 */
public class ForecastConditions implements Observer {
    private float temperature;
    private float pressure;
    private float humidity;

    public void update(float temperature, float pressure, float humidity) {
        this.temperature = temperature;
        this.pressure = pressure;
        this.humidity = humidity;
        display();
    }

    private void display(){
        System.out.println("***tomorrow temperature:" + (temperature + Math.random()) + "***");
        System.out.println("***tomorrow pressure:" + (pressure + Math.random()) + "***");
        System.out.println("***tomorrow humidity:" + (humidity + Math.random()) + "***");
    }
}
